package com.k136.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.k136.entity.Driverschool;
import com.k136.mapper.DriverschoolMapper;
import com.k136.service.DriverschoolService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * TODO 类
 *
 * @author LiuTai
 * @version 1.00
 * @Date 2024/11/8
 */
@Service
public class DriverschoolServiceImpl implements DriverschoolService {
    @Resource
    private DriverschoolMapper driverschoolMapper;
    @Override
    public PageInfo<Driverschool> selDriverschool(Integer cityAreaId, Integer pageNo, Integer pageSize) {
        PageHelper.startPage(pageNo,pageSize);
        List<Driverschool> people = driverschoolMapper.selectAllDriverschool(cityAreaId);
        PageInfo<Driverschool> pageInfo=new PageInfo<>(people);
        return pageInfo;
    }

    @Override
    public Driverschool selDriverschoolById(Integer id) {
        return driverschoolMapper.selectDriverschoolById(id);
    }

    @Override
    public Boolean updDriverschoolById(Driverschool driverschool) {
        return driverschoolMapper.updateDriverschoolById(driverschool)>0?true:false;
    }
}
